/*
 * @Author: Jimmy
 * @LastModifiedBy: Jimmy
 * @Date: 2024-02-25 19:05:38
 * @LastEditTime: 2024-06-23 14:07:39
 * @FilePath: /nest_study/web/src/components/pageWrapper/index.tsx
 */
import styles from './index.module.scss'
import BreadCrumber from '@/layout/components/crumber'
import { Flex } from 'antd';

type PageProps = {
  children?: JSX.Element
  showBread?: boolean//是否显示面包屑
  hideBg?: boolean//隐藏页面背景色
}

const PageWrapper = (props: PageProps) => {
  let { showBread = true, hideBg = true } = props;
  return (
    <Flex vertical flex={1} gap={10} className={styles.page_wrapper}>
      {
        showBread && <div className={styles.breadcrumb}><BreadCrumber /></div>
      }
      <Flex vertical flex={1} gap={20} className={`${styles.page_main} ${hideBg && styles.hideBg} ${showBread && styles.showBread}`}>
        {props.children}
      </Flex>
    </Flex>
  )
}

export default PageWrapper